package exception;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;

public class AutoCloseDemo {
    public static void main(String[] args) {
        try(
                FileOutputStream fos = new FileOutputStream("demo.dat");
        ){
            fos.write(1);
        } catch (Exception e) {
            System.out.println("出错了");
        }
    }
}
